//
//  IMSearchToolButton.m
//  MyPhoneApp
//
//  Created by baken on 2016/10/24.
//  Copyright © 2016年 myApp. All rights reserved.
//

#import "IMSearchToolButton.h"

#define imageWidth  15
#define separateWith 10

@implementation IMSearchToolButton

- (instancetype)init{
    
    if (self = [super init]) {
        self.imageView.contentMode = UIViewContentModeCenter;
        [self.titleLabel setFont:[UIFont systemFontOfSize:14]];
        [self setTitleColor:UIColorFromRGB(kDarkFontColor) forState:UIControlStateNormal];
       
    }
    return self;
}


-(CGRect)titleRectForContentRect:(CGRect)contentRect{
    return CGRectMake(imageWidth + separateWith, 0, contentRect.size.width - imageWidth - separateWith, contentRect.size.height);
}


- (CGRect)imageRectForContentRect:(CGRect)contentRect{
    return CGRectMake(0, 0, imageWidth, contentRect.size.height);
}

@end
